import request from "@/api/request"

export function getCategoryByType(type){
    return request({
        method: 'get',
        url: '/api/category/type',
        params: {
            type: type,
        },
    })
}

export function editCategoryName(id,name){
    return request({
        method: 'put',
        url: '/api/category/' + id,
        params: {
            categoryName: name
        }
    })
}

export function delCategory(id,name){
    return request({
        method: 'delete',
        url: '/api/category/' + id,
    })
}

export function addCategory(category){
    return request({
        method: 'post',
        url: '/api/category/type',
        data: category
    })
}